Skip to content

[6.19.z] Fix OSP compute resource cleanup - #22231

Merged
Satellite-QE merged 1 commit into
6.19.zfrom
cherry-pick-6.19.z-600d95371fe1655c7caea3077705f670d6ec8204
Jul 23, 2026
Merged

[6.19.z] Fix OSP compute resource cleanup#22231
Satellite-QE merged 1 commit into
6.19.zfrom
cherry-pick-6.19.z-600d95371fe1655c7caea3077705f670d6ec8204

Conversation

@Satellite-QE

Copy link
Copy Markdown
Collaborator

Cherrypick of PR: #22170

Problem Statement

The OSP compute resource cleanup finalizer was buggy: it always received the CR numeric id, but used the parametrized id_type (id or name) as the delete/search key. For the name parametrization this became delete({'name': '<numeric_id>'}), so cleanup could fail silently. Failed deletes were swallowed with bare pass, which made leaked Satellite CRs (and related OSP SSH key pairs) hard to notice.

Solution

Always delete and verify the compute resource by id in cr_cleanup, and log a warning when deletion fails so leftover CRs/key pairs are visible in test logs.

PRT test Cases example

trigger: test-robottelo
pytest: tests/foreman/cli/test_computeresource_osp.py -k test_crud_and_duplicate_name

Summary by Sourcery

Fix OSP compute resource cleanup in tests to always delete by numeric ID and surface failures via logging.

Bug Fixes:

  • Ensure OSP compute resources are always deleted and verified by numeric ID instead of a parameterized identifier that could be incorrect.

Enhancements:

  • Log a warning when OSP compute resource deletion fails so potential SSH key pair leaks are visible in test output.

Tests:

  • Update OSP compute resource CLI test finalizer wiring to use the corrected cleanup helper signature.

* Fix OSP compute resource cleanup

* delete by both name and id

---------

Co-authored-by: Arvind Jangir <ajangir@redhat.com>
(cherry picked from commit 600d953)
@Satellite-QE Satellite-QE added 6.19.z Auto_Cherry_Picked Automatically cherrypicked PR using GHA No-CherryPick PR doesnt need CherryPick to previous branches labels Jul 23, 2026
@Satellite-QE

Copy link
Copy Markdown
Collaborator Author
trigger: test-robottelo
pytest: tests/foreman/cli/test_computeresource_osp.py -k test_crud_and_duplicate_name

@Satellite-QE Satellite-QE added AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing No-CherryPick PR doesnt need CherryPick to previous branches Auto_Cherry_Picked Automatically cherrypicked PR using GHA 6.19.z labels Jul 23, 2026
@Satellite-QE

Copy link
Copy Markdown
Collaborator Author

PRT Result

Build Number: 16207
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_computeresource_osp.py -k test_crud_and_duplicate_name --external-logging
Test Result : =========== 4 passed, 3 deselected, 29 warnings in 978.95s (0:16:18) ===========

@Satellite-QE
Satellite-QE merged commit c2a9750 into 6.19.z Jul 23, 2026
18 of 24 checks passed
@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Jul 23, 2026
@Satellite-QE
Satellite-QE deleted the cherry-pick-6.19.z-600d95371fe1655c7caea3077705f670d6ec8204 branch July 23, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.19.z Auto_Cherry_Picked Automatically cherrypicked PR using GHA AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants